首页> 外文OA文献 >Practical, general parser combinators
【2h】

Practical, general parser combinators

机译:实用的通用解析器组合器

代理获取
本网站仅为用户提供外文OA文献查询和代理获取服务,本网站没有原文。下单后我们将采用程序或人工为您竭诚获取高质量的原文,但由于OA文献来源多样且变更频繁,仍可能出现获取不到、文献不完整或与标题不符等情况,如果获取不到我们将提供退款服务。请知悉。

摘要

textabstractParser combinators are a popular approach to parsing where contextfree grammars are represented as executable code. However, conventional parser combinators do not support left recursion, and can have worst-case exponential runtime. These limitations hinder the expressivity and performance predictability of parser combinators when constructing parsers for programming languages. In this paper we present general parser combinators that support all context-free grammars and construct a parse forest in cubic time and space in the worst case, while behaving nearly linearly on grammars of real programming languages. Our general parser combinators are based on earlier work on memoized Continuation- Passing Style (CPS) recognizers. First, we extend this work to achieve recognition in cubic time. Second, we extend the resulting cubic CPS recognizers to parsers that construct a binarized Shared Packed Parse Forest (SPPF). Our general parser combinators bring the best of both worlds: the flexibility and extensibility of conventional parser combinators and the expressivity and performance guarantees of general parsing algorithms. We used the approach presented in this paper as the basis for Meerkat, a general parser combinator library for Scala.
机译:textabstractParser组合器是一种流行的解析方法,其中上下文无关的语法表示为可执行代码。但是,常规解析器组合器不支持左递归,并且可能具有最坏情况的指数运行时间。这些限制阻碍了为编程语言构造解析器时解析器组合器的表达能力和性能可预测性。在本文中,我们提出了通用的解析器组合器,它们支持所有无上下文的语法,并在最坏的情况下在立方时间和空间中构建一个解析森林,同时几乎线性地表现真实的编程语言的语法。我们的通用解析器组合器基于早期的记忆式连续传递样式(CPS)识别器。首先,我们扩展这项工作以在立方时间内获得认可。其次,我们将得到的立方CPS识别器扩展到构造二进制化共享打包解析森林(SPPF)的解析器。我们的通用解析器组合器具有两全其美的优点:常规解析器组合器的灵活性和可扩展性,以及通用解析算法的可表达性和性能保证。我们使用本文提出的方法作为Meerkat(Scala的通用解析器组合器库)的基础。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
代理获取

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号